package com.zhangx.datastructure.search.dto;

import lombok.Data;

/**
 * @ClassName BiNode
 * @Description 二叉树节点
 * @Author zhangx
 * @Date 2021/1/25 8:45
 **/
@Data
public class BiNode {
    private int data;
//    左节点
    private BiNode lchild;
//    右节点
    private BiNode rchild;
//    平衡因子-用于AVL树
    private int bf;

    public BiNode(int data,BiNode lchild,BiNode rchild){
        this.data = data;
        this.lchild = lchild;
        this.rchild = rchild;
    }

    public BiNode(){

    }

    public BiNode(int data){
        this.data = data;
    }

    @Override
    public String toString() {
        return "BiNode{" +
                "data=" + data +
                ",lchild=" + lchild +
                ",rchild=" + rchild +
                '}';
    }
}
